package com.aspose.cells.a.d;

public class zfb extends zdw {
   private zdf g;
   private zew h;
   private zfj i = new zfj();
   private zfj j = new zfj();

   public zfb(zdh var1, String var2, int var3) throws Exception {
      super(var1, var2, var3, true);
      this.g = new zdf(var1, this);
      this.h = new zew(var1, false);
      this.j.a(0, 0);
      this.i.a(0, 0);
   }

   public byte[] a(String var1) {
      byte[] var2 = new byte[var1.length() * 2];
      int var3 = 0;

      for(int var4 = 0; var4 < var1.length(); ++var4) {
         char var5 = var1.charAt(var4);
         if (var5 == 8206 || var5 == 8207) {
            var5 = 8203;
         }

         Object var7 = this.i.e(var5);
         int var6;
         if (var7 != null) {
            var6 = (Integer)var7;
         } else {
            int var8 = this.c.a(var5);
            var7 = this.j.e(var8);
            if (var7 != null) {
               var6 = (Integer)var7;
               this.i.a(var5, var6);
            } else {
               var6 = this.j.a();
               this.j.a(var8, var6);
               this.i.a(var5, var6);
            }
         }

         var2[var3++] = (byte)(var6 >> 8 & 255);
         var2[var3++] = (byte)(var6 & 255);
      }

      return var2;
   }

   public void a(com.aspose.cells.b.a.d.zm var1) throws Exception {
      zfs var2 = new zfs(false);
      var2.a(this.c, this.j, var1, false, false);
   }

   public String s() {
      StringBuilder var1 = new StringBuilder();
      var1.append("[");

      for(int var2 = 0; var2 < this.i.a(); ++var2) {
         char var3 = (char)this.i.d(var2);
         int var4 = (Integer)this.i.c(var2);
         zfu var5 = this.c.f().b(var3);
         String var6 = com.aspose.cells.a.c.zp.a(var4) + "[" + com.aspose.cells.a.c.zp.a(this.a(var5.c())) + "]";
         var1.append(var6);
      }

      var1.append("]");
      return com.aspose.cells.b.a.zr.a(var1);
   }

   public void a(zeg var1) throws Exception {
      this.b(var1);
      this.g.a = this.i.a();
      this.g.a(var1);
      this.c(var1);
   }

   public String r() {
      StringBuilder var1 = new StringBuilder();
      var1.append("F");
      String var2 = com.aspose.cells.b.a.zv.a("{0,number,00000}", super.m());
      byte var3 = 17;

      for(int var4 = 0; var4 < var2.length(); ++var4) {
         var1.append((char)(var2.charAt(var4) + var3));
      }

      return com.aspose.cells.b.a.zr.a(var1);
   }

   private void b(zeg var1) throws Exception {
      var1.a(this);
      var1.g();
      var1.a("/Type", "/Font");
      var1.a("/Subtype", "/Type0");
      var1.a("/Encoding", "/Identity-H");
      var1.a("/BaseFont", com.aspose.cells.b.a.zv.a("/{0}", this.d));
      var1.a("/DescendantFonts", com.aspose.cells.b.a.zv.a("[{0}]", this.g.n()));
      var1.a("/ToUnicode", this.h.n());
      var1.h();
      var1.b();
   }

   private void c(zeg var1) throws Exception {
      this.h.b("/CIDInit /ProcSet findresource begin");
      this.h.b("11 dict begin");
      this.h.b("begincmap");
      this.h.b("/CIDSystemInfo");
      this.h.b("<< /Registry (Adobe)");
      this.h.b("/Ordering (UCS)");
      this.h.b("/Supplement 0");
      this.h.b(">> def");
      this.h.b("/CMapName /Adobe-Identity-UCS def");
      this.h.b("/CMapType 2 def");
      this.h.b("1 begincodespacerange");
      this.h.b("<0000><FFFF>");
      this.h.b("endcodespacerange");
      this.t();
      this.h.b("endcmap");
      this.h.b("CMapName currentdict /CMap defineresource pop");
      this.h.b("end");
      this.h.b("end");
      this.h.a(var1);
   }

   private void t() throws Exception {
      zfj var1 = this.u();
      this.h.b(var1.a() + " beginbfchar");
      StringBuilder var2 = new StringBuilder(16);

      for(int var3 = 0; var3 < var1.a(); ++var3) {
         int var4 = var1.d(var3);
         int var5 = (Integer)var1.c(var3);
         var2.setLength(0);
         var2.append('<');
         var2.append(com.aspose.cells.a.c.zp.d(var4));
         var2.append("><");
         var2.append(com.aspose.cells.a.c.zp.d(var5));
         var2.append('>');
         this.h.b(com.aspose.cells.b.a.zr.a(var2));
      }

      this.h.b("endbfchar");
   }

   private zfj u() {
      zfj var1 = new zfj();

      for(int var2 = 0; var2 < this.i.a(); ++var2) {
         int var3 = this.i.d(var2);
         int var4 = (Integer)this.i.c(var2);
         var1.b(var4, var3);
      }

      return var1;
   }

   protected void b() {
      StringBuilder var1 = new StringBuilder();
      var1.append(this.f);
      var1.append("+");
      var1.append(this.c.d());
      if (this.d() && this.c()) {
         var1.append(",BoldItalic");
      } else if (this.d()) {
         var1.append(",Bold");
      } else if (this.c()) {
         var1.append(",Italic");
      }

      this.d = com.aspose.cells.b.a.zr.a(var1);
   }

   public boolean l() {
      return true;
   }
}
